/*
 * Copyright (c)  2016, dabing.io
 * All rights reserved.
 * CustomerEntity.java 2017-09-16 上午7:30
 */

package com.ueboot.weishop.entity.customer;

import com.ueboot.weishop.entity.IDEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 描述:客户信息表
 * 所有在平台上下过订单的用户都会保存为客户信息表。针对微信平台采用openId作为客户唯一标识
 *
 * @author yangkui create on 2017-09-16.
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity(name = "WS_CUSTOMER_INFO")
public class CustomerInfoEntity extends IDEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_CUSTOMER_INFO")
    @GenericGenerator(name = "WS_CUSTOMER_INFO", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_CUSTOMER_INFO"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled")})
    @Column(name = "ID", columnDefinition = "INT(20) COMMENT 'id主键'", length = 20)
    private Long id;
    /**
     * 用户昵称，微信明细
     */
    @Column(name = "NICK_NAME",columnDefinition = "VARCHAR(200) COMMENT '用户昵称，微信明细'",length = 200)
    private String nickname;

    /**
     * 微信OPENID;
     */
    @Column(name = "OPEN_ID",columnDefinition = "VARCHAR(200) COMMENT '微信OPENID'",length = 200)
    private String openId;
    /**
     * 邮箱
     */
    @Column(name = "EMAIL",columnDefinition = "VARCHAR(200) COMMENT '邮箱'",length = 200)
    private String email;
    /**
     * 最后登录时间
     */
    @Column(name = "LAST_LOGIN_TIME",columnDefinition = "DATE COMMENT '最后登录时间'")
    private Date lastLoginTime;
    /**
     * 手机号
     */
    @Column(name = "MOBILE",columnDefinition = "VARCHAR(40) COMMENT '手机号'",length = 40)
    private String mobile;
    /**
     * 真实姓名
     */
    @Column(name = "NAME",columnDefinition = "VARCHAR(200) COMMENT '真实姓名'",length = 200)
    private String name;
    /**
     * 性别：男|女
     */
    @Column(name = "GENDER",columnDefinition = "VARCHAR(10) COMMENT '性别：男|女'",length = 10)
    private String gender;
    /**
     * 所属区域：到省级
     */
    @Column(name = "AREA",columnDefinition = "VARCHAR(40) COMMENT '所属区域：到省级'",length = 40)
    private String area;
    /**
     * 头像地址
     */
    @Column(name = "HEADER_IMG_URL",columnDefinition = "VARCHAR(200) COMMENT '头像地址'",length = 200)
    private String headerImgUrl;
    /**
     * 注册时的IP
     */
    @Column(name = "REGISTER_IP",columnDefinition = "VARCHAR(200) COMMENT '注册时的IP'",length = 200)
    private String registerIp;
    /**
     * 最后登录时的IP
     */
    @Column(name = "LOGIN_IP",columnDefinition = "VARCHAR(40) COMMENT '最后登录时的IP'",length = 40)
    private String loginIp;
    /**
     * 会员等级
     */
    @Column(name = "MEMBER_RANK",columnDefinition = "INT(2) COMMENT '优惠券名称'",length = 2)
    private int memberRank;


}